<!DOCTYPE html>
<html lang="zh" mode="light" xmlns:th="http://www.thymeleaf.org">

<head>
    <div th:replace="~{theme/Grace/common :: meta}"></div>
    <meta property="og:title" th:content="${'动态 | ' + #servletContext.getAttribute('configMap')['blog_name']}" />
    <title>动态 | [[${#servletContext.getAttribute('configMap')['blog_name']}]]</title>
    <div th:replace="~{theme/Grace/common :: link}"></div>
</head>

<body>
<!-- 导航 -->
<div th:replace="~{theme/Grace/common :: nav}"></div>
<div class="wrap" id="wrap">
    <div class="grace-content">
        <!-- 头部 -->
        <header class="header">
            <!-- 封面 -->
            <div class="cover">
                <img th:if="${#strings.startsWith(currentNav.cover,'http')}" class="lazyload" th:data-original="@{${currentNav.cover}}">
                <img th:if="${#strings.startsWith(currentNav.cover,'http') == false}" class="lazyload" th:data-original="@{${prefix} + '/source/images/dynamic.png'}">
            </div>

            <!-- 商标 -->
            <div class="brand animate-box" data-animate-effect="fadeIn">
                <p class="title"><span class="title-head">『</span> 动态 <span class="title-tail">』</span></p>
                <p class="sub-title"></p>
            </div>
        </header>
        <!-- 主要内容 -->
        <main class="main">
            <div class="container">
                <div class="dynamic-list" id="dynamicList">
                    <div class="dynamic-item animate-box" th:each="dynamic : ${pageInfo.list}" th:data-color="${dynamic.color}" th:style="'--block-color:' + ${dynamic.color} ">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="info">
                                    <div class="content" th:utext="${dynamic.content}"></div>
                                </div>
                                <div class="meta">
                                    <span class="date">
                                        <i class="fa fa-clock-o"></i> 发布于 [[${dynamic.timeDesc}]]
                                    </span>
                                    <a class="praise" href="javascript:void(0)" th:data-id="${dynamic.id}">
                                        <i class="fa fa-heart-o"></i>&nbsp;<span class="praise-num">[[${dynamic.praiseNum}]]</span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="pagination animate-box">
                    <span th:if="${pageInfo.hasPreviousPage}" class="page">
                        <a data-pjax class="prev page-numbers" th:href="@{${pageInfo.pageNum-1} == 1 ? '/dynamics/' : '/dynamics/page/' + ${pageInfo.pageNum-1}+'/'}" ><i class="fa fa-angle-left"></i></a>
                    </span>
                    <span th:each="pageNum : ${pageInfo.navigatepageNums}" th:if="${pageInfo.navigatepageNums.length} le '4' ">
                        <span th:if="${pageNum == pageInfo.pageNum}"  class="page current" th:text="${pageNum}"></span>
                        <span class="page" th:if="${pageNum != pageInfo.pageNum}">
                            <a data-pjax th:href="@{'/dynamics/page/' + ${pageNum}+'/'}" th:text="${pageNum}"></a>
                        </span>
                    </span>
                    <span th:each="pageNum, iterStat : ${pageInfo.navigatepageNums}" th:if="${pageInfo.navigatepageNums.length} gt '4' ">
                       <span class="page omit" th:if="${pageNum == pageInfo.pageNum and iterStat.count gt 2 and iterStat.count le iterStat.size}">...</span>
                       <span th:if="${pageNum == pageInfo.pageNum}" class="page current" th:text="${pageNum}"></span>
                       <span class="page omit" th:if="${pageNum == pageInfo.pageNum and iterStat.count le (iterStat.size - 2)}">...</span>
                       <span th:if="${pageNum != pageInfo.pageNum}">
                           <span class="page" th:if="${iterStat.count == 1}" ><a data-pjax th:href="@{'/dynamics/page/1/'}" th:text="1"></a></span>
                           <span class="page" th:if="${iterStat.count == (iterStat.size)}"><a data-pjax th:href="@{'/dynamics/page/' + ${pageNum}+'/'}" th:text="${pageNum}"></a></span>
                        </span>
                   </span>
                    <span th:if="${pageInfo.hasNextPage}" class="page">
                        <a data-pjax class="next page-numbers" th:href="@{'/dynamics/page/' + ${pageInfo.pageNum+1}+'/'}" ><i class="fa fa-angle-right"></i></a>
                    </span>
                </div>
            </div>
        </main>
    </div>
</div>
<!-- 尾部 -->
<div th:replace="~{theme/Grace/common :: footer}"></div>
<div th:replace="~{theme/Grace/common :: script}"></div>
</body>

</html>
